package com.ssy.lingxi.transaction.config;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.persistence.EntityManager;

/**
 * 交易服务配置
 * @author xiaomai
 * @version 2.0.0
 * @date 2022-04-01
 */
@Configuration
public class TransactionServiceConfig {

    /**
     * QueryDsl Bean 配置
     * @param entityManager Jpa的EntityManager
     * @return QueryDsl JpaQueryFactory，直接注入使用
     */
    @Bean
    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }


}
